package sample.tree;

import sample.tree.visitor.VoidVisitorAdapter;
import sample.tree.node.expr.Add;
import sample.tree.node.expr.Sub;
import sample.tree.node.expr.Mul;
import sample.tree.node.expr.Div;
import sample.tree.node.expr.Const;

final class NodesCollector extends VoidVisitorAdapter {

	Context context = new Context();

	@Override
	public void exitAdd(
			final Add node)
	{
		context.intern(node);
	}

	@Override
	public void exitSub(
			final Sub node)
	{
		context.intern(node);
	}

	@Override
	public void exitMul(
			final Mul node)
	{
		context.intern(node);
	}

	@Override
	public void exitDiv(
			final Div node)
	{
		context.intern(node);
	}

	@Override
	public void exitConst(
			final Const node)
	{
		context.intern(node);
	}
}
